package com.tubi.阻塞队列;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie  extends  Thread{

    public  ArrayBlockingQueue<String> list;
    public Foodie(ArrayBlockingQueue<String> list) {
            this.list = list;
    }

    @Override
    public void run() {
        while (true){
            try {
                String take =  list.take();
                System.out.println("吃货"+take);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
